<template>
	<view class="">
		<view class="details m16">
			<view class="bgw br6 mb16" v-for="(item,index) in userArray" :key="index">
				<view class="mlr20">
					<list
						:label="item.userNo+'('+item.userKindDes+')'"
						class="bb ptb8"
						lableColor="blue"
						:isShowBtn="true"
						@show="show(item.uniqueId,item.uniqueType,item.reqUrlCode)"
						:value="item.userNo">
					</list>
					<list label="用户姓名" :value='item.userName' color="red"></list>
					<list label="用户地址" :value="item.addrName "></list>
					<list label="表具号码" :value="item.meterNo"></list>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
import list from '../../components/List.vue';
let api = require('../../utils/api.js');
let util = require('../../utils/utils.js');
export default {
	data() {
		return {
			userArray: [],
			type:'',
		}
	},
	components: {
		list
	},
	async onShow(options) {
		let data = await util.getStorage("config");
		this.userArray = data.data.userArray;
	},
	onLoad(option){
		console.log(option)
		this.type = option.type;
	},
	methods: {
		show(uniqueId,uniqueType,reqUrlCode) {
			
			if(this.type == 1){
				util.navigateTo(`/pages/query/pay?uniqueId=${uniqueId}&uniqueType=${uniqueType}&reqUrlCode=${reqUrlCode}`);
			}else if(this.type == 2){
				util.navigateTo(`/pages/query/record?uniqueId=${uniqueId}&uniqueType=${uniqueType}&reqUrlCode=${reqUrlCode}`);
			}else if(this.type == 3){
				util.navigateTo(`/pages/query/readMeter?uniqueId=${uniqueId}&uniqueType=${uniqueType}&reqUrlCode=${reqUrlCode}`);
			}
		}
	},
};
</script>

<style lang="scss">
page {
	background-color: $uni-bg-color-grey;
}
</style>